:root {
  /* 浅色主题 */
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --text-color: #2c3e50;
  --text-color-secondary: #666666;
  --border-color: #ecf0f1;
  --background-color: #f9fafb;
  --card-background: #ffffff;
  --nav-background: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.05);
}

/* 深色主题 */
[data-theme='dark'] {
  --primary-color: #60a5fa;
  --secondary-color: #4ade80;
  --danger-color: #f87171;
  --text-color: #e2e8f0;
  --text-color-secondary: #cbd5e1;
  --border-color: #2d3748;
  --background-color: #1a1a1a;
  --card-background: #2d3748;
  --nav-background: #1e293b;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'CustomFont';
  src: local('PingFang SC'), local('Microsoft YaHei'), local('Helvetica Neue');
}

body {
  font-family: 'CustomFont', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: var(--primary-color);
  color: var(--card-background);
  font-family: inherit;
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

input,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: var(--card-background);
  color: var(--text-color);
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  :root {
    --nav-height: 60px;
    --content-padding: 12px;
  }

  body {
    font-size: 14px;
  }

  input,
  textarea {
    font-size: 16px; /* 防止iOS自动放大 */
  }

  button {
    padding: 8px 12px;
    font-size: 14px;
  }

  .nav-content {
    padding: 0 var(--content-padding);
  }

  .logo {
    font-size: 18px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    padding: 6px 10px;
  }

  main {
    padding: var(--content-padding);
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    bottom: 16px;
    right: 16px;
  }
}

/* 平板适配 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  :root {
    --nav-height: 70px;
    --content-padding: 16px;
  }

  body {
    font-size: 15px;
  }

  .nav-content {
    padding: 0 var(--content-padding);
  }

  main {
    padding: var(--content-padding);
  }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-width: 896px) {
  .app {
    min-height: 100vh;
  }

  main {
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
  }
}

/* 添加禁止选中的类 */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
